dotnet tool uninstall --global dotnet-ef
dotnet tool install --global dotnet-ef --version 6.0.0
dotnet tool install --global dotnet-ef --version 6.0.0-preview.7.21378.4

dotnet ef database drop -f

dotnet ef dbcontext scaffold "server=.,5433;Database=AutoLot;User Id=sa;Password=P@ssw0rd;" Microsoft.EntityFrameworkCore.SqlServer --data-annotations -c ApplicationDbContext --context-namespace AutoLot.Dal.EfStructures --context-dir EfStructures --no-onconfiguring -n AutoLot.Models.Entities -o ..\AutoLot.Models\Entities -f
dotnet ef dbcontext scaffold "server=(localdb)\mssqllocaldb;Database=AutoLot;Integrated Security=true" Microsoft.EntityFrameworkCore.SqlServer --data-annotations -c ApplicationDbContext --context-namespace AutoLot.Dal.EfStructures --context-dir EfStructures --no-onconfiguring -n AutoLot.Models.Entities -o ..\AutoLot.Models\Entities -f

dotnet ef migrations add Initial -o EfStructures\Migrations -c AutoLot.Dal.EfStructures.ApplicationDbContext
dotnet ef migrations list -c AutoLot.Dal.EfStructures.ApplicationDbContext
dotnet ef migrations script 0 Initial --idempotent -o ..\FirstMigration.sql -c AutoLot.Dal.EfStructures.ApplicationDbContext

dotnet ef database update Initial -c AutoLot.Dal.EfStructures.ApplicationDbContext

dotnet ef migrations add UpdatedEntities -o EfStructures\Migrations -c AutoLot.Dal.EfStructures.ApplicationDbContext
dotnet ef database update UpdatedEntities -c AutoLot.Dal.EfStructures.ApplicationDbContext

dotnet ef migrations remove

dotnet ef migrations add MoveHxToDifferentSchema -o EfStructures\Migrations -c AutoLot.Dal.EfStructures.ApplicationDbContext
dotnet ef database update MoveHxToDifferentSchema -c AutoLot.Dal.EfStructures.ApplicationDbContext

dotnet ef migrations remove

dotnet ef migrations add SQL -o EfStructures\Migrations -c AutoLot.Dal.EfStructures.ApplicationDbContext
dotnet ef database update SQL -c AutoLot.Dal.EfStructures.ApplicationDbContext

dotnet ef migrations remove

dotnet ef migrations script --idempotent 0 initial -o FinalMigration.sql

